﻿using AutoMapper;
using SIG.Model.Identity;
using SIG.Service;
using SIG.ViewModel.Front.Menus;
using System.Collections.Generic;
using System.Web.Mvc;

namespace SIG.WebMVC.Controllers
{
    public class MenuController : BaseController
    {
        private readonly ICategoryService _categoryService;
        private readonly IMenuService _menuService;
        private readonly IMapper _mapper;

        public MenuController(IMenuService menuService, ICategoryService categoryService, IMapper mapper)
        {
            _menuService = menuService;
            _categoryService = categoryService;
            _mapper = mapper;

        }
        public PartialViewResult GetMenus()
        {
           var menus = _menuService.GetFaltMenus(2);
            var vm = _mapper.Map<List<Menu>, List<MenuVM>>(menus);
            return PartialView("_siteNav", vm);
        }
    }
}